use std::ops::{Deref, DerefMut};
use crate::error::AppErr;


pub struct Cbor<T>(pub T);

impl<T> Deref for Cbor<T> {

    type Target = T;

    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

impl<T> DerefMut for Cbor<T> {

    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}

pub type CborRet<T> = Result<Cbor<T>, AppErr>;

pub fn new_cbor<T>(v: T) -> CborRet<T> {
    Ok(Cbor(v))
}

pub struct Void;


pub type VoidRet = Result<Void, AppErr>;


